# locust777

//
////模拟实现strlen
//#include<stdio.h>
//int my_strlen(char* str)
//{
//int count = 0;
//while(*str != '\0')
//{
//count++;
//str++;//找下一个字符
//}
//return count;
//}
//int main()
//{
//	char arr[] = "abc";//[a b c \0]
//	printf("%d\n",my_strlen(arr));
//	scanf("%d",arr);
//return 0;
//}


////strlen用递归写2
//int my_strlen(char*str)
//{
//	if(*str != '\0')
//		return 1+my_strlen(str+1);
//	else
//	    return 0;
//}
//#include<stdio.h>
//int main()
//{
//	char arr[] = "abc";//[a b c \0]
//	int len = my_strlen(arr);
//	printf("%d",len);
//    scanf("%d",arr);
//
//	return 0;
//}


////递归阶乘1
//
//int fac(int n)
//{
//if (n <= 1)
//	return 1;
//else
//	return n * fac(n-1);//与文中报错
//}
//int main()
//{
//	int n = 0;
//	scanf("%d",&n);
//	int len = fac(n)
//	printf("ret = %d\n",len);
//	scanf("%d",n);
//return 0;
//}


//
////迭代方式--非递归
//int fac(int n)
//{
//int i = 0;
//int ret = 1;
//for( i = 1; i <= n;i++)
//{
//	ret *= i;
//}
//return ret;
//}
//#include<stdio.h>
//int main()
//{
//	int n = 0;
//	scanf("%d",n);
//	printf("ret = %d\n",fac(n));
//	scanf("%d",n);
//return 0;
//}




////求n个斐波那契数
////1 1 2 3 5 8 13 21 34 55....
//int Fib(int n)
//{
//if(n <= 2)
//	return 1;
//else
//    return Fib(n - 1)+ Fib(n - 2);
//}
//#include<stdio.h>
//int main()
//{
//	int n = 3;
//	scanf("%d",&n);
//	printf("%d",Fib(n));
//	scanf("%d",&n);
//return 0;
//}

//
//////优化方案2
////int Fib(int n)
////{
////int a = 1;
////int b = 1; 
////int c = 0;
////while (n >= 3)
////{
////c =a + b;
////a = b;
////b = c;
////n--;
////}
////return c;
////}
////#include<stdio.h>
////int main()
////{
////	int n = 3;
////	scanf("%d",&n);
////	printf("%d",Fib(n));
////	scanf("%d",&n);
////return 0;
////}

////
////void test(int n)//
////{
////int num = 10;
////int arr[30];
////if(n < 10000)
////	test(n + 1);
////}
////
////int main()
////{
////	test(1);
////return 0;
////}


